Skip to content

feat(scaffold-core@1.2.0): add buildOracleContext helper (charter#224)#225

Merged
stackbilt-admin merged 1 commit into
mainfrom
feat/oracle-context
Jun 12, 2026
Merged

feat(scaffold-core@1.2.0): add buildOracleContext helper (charter#224)#225
stackbilt-admin merged 1 commit into
mainfrom
feat/oracle-context

Conversation

@stackbilt-admin

Copy link
Copy Markdown
Member

What

Adds buildOracleContext(result: LocalScaffoldResult): OracleContext helper and OracleContext type to @stackbilt/scaffold-core.

Why

After migrating stackbilt-web routes from the local shim to @stackbilt/scaffold-core@1.1.0, the oracle LLM polish pass was receiving {} context — prompt_context is now null because the npm package doesn't emit it. Pro users on the --oracle path were silently getting degraded output.

buildOracleContext derives the same structured context from the existing LocalScaffoldResult fields, without any additional inference or network calls.

Changes

  • types.ts: Add OracleContext interface
  • index.ts: Add buildOracleContext() function + export OracleContext type
  • __tests__/oracle-context.test.ts: 4 tests (field mapping, bindings, topThreats cap, adr002 null)

Consumer update (stackbilt-web)

After this ships, update pages/api/flows/index.ts:

// Before
const oracleResult = await runOracle((result.prompt_context ?? {}) as any, cfEnv as any);

// After
import { buildOracleContext } from '@stackbilt/scaffold-core';
const oracleResult = await runOracle(buildOracleContext(scaffold), cfEnv as any);

Closes charter#224. Part of charter#223 checklist.

Derives structured OracleContext from a LocalScaffoldResult for use by
an LLM oracle polish pass. Replaces the promptContext field that was
stripped when migrating stackbilt-web routes from the local shim to
the npm package — Pro users on the oracle path were receiving {} context.

All fields are derived from existing LocalScaffoldResult data — no
additional inference or network calls required.

Exports: buildOracleContext(result), OracleContext type

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@stackbilt-admin stackbilt-admin merged commit ddb9ca1 into main Jun 12, 2026
3 of 4 checks passed
@stackbilt-admin stackbilt-admin deleted the feat/oracle-context branch June 12, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant